package com.zhongshengnetwork.rightbe.common;

import android.app.Activity;
import android.os.Build;
import android.view.View;

/**
 * Created by luojingxing on 2018/12/1.
 */

public class StatusBarFontUtil {
    /**
     * 黑色字体状态栏
     * @param activity
     */
    public static void setLightStatusBarColor(Activity activity) {

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            activity.getWindow()
                    .getDecorView()
                    .setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                            |View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
        }
    }

    /**
     * 白色字体状态栏
     * @param activity
     */
    public static void setWhiteStatusBarColor(Activity activity) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            activity.getWindow()
                    .getDecorView()
                    .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
        }
    }

}
